package com.yunkeji.dao.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunkeji.common.core.mapper.BaseMapperPlus;
import com.yunkeji.dao.domain.UserBanned;
import com.yunkeji.dao.vo.UserBannedVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 封号信息Mapper接口
 *
 * @author 老张
 * @date 2024-05-27
 */
public interface UserBannedMapper extends BaseMapperPlus<UserBannedMapper, UserBanned, UserBannedVo> {

    @Select("<script>" +
        "SELECT  " +
        "b.*,  " +
        "u.sex   " +
        "FROM  " +
        "ykj_user_banned b  " +
        "LEFT JOIN ykj_app_user u ON b.user_id = u.id " +
        "where 1=1 " +
        "<if test='phone!=null'>" +
        "and b.phone_num = #{phone} " +
        "</if>" +
        "<if test='platformId!=null'>" +
        "and b.platform_id = #{platformId} " +
        "</if>" +
        "<if test='limitType!=null'>" +
        "and b.limit_type = #{limitType} " +
        "</if>" +
        "order by b.create_time desc " +
        "</script>")
    Page<UserBannedVo> selectListPage(@Param("phone") String phone,
                                      @Param("platformId") String platformId,
                                      @Param("limitType") Integer limitType,
                                      @Param("Page") Page<UserBanned> Page);
}
